<?php
$ext_frontpage=array_map('trim',explode("\n",gbuffer('ext','frontpage')));
function frontpage_init(){
	global $_v, $ext_frontpage;
	if($_v['p']||$_v['pg']||$_v['t']||$_v['ext']||$_v['e']||$_v['action']||$_v['skip']||(@$_v[$ext_frontpage[1]]&&($_v[$ext_frontpage[1]]==$ext_frontpage[2])));
	elseif($ext_frontpage[0])$_v['pg']=$ext_frontpage[0];
}
function ext_frontpage_blog_skip($return,$args){
	global $_s,$ext_frontpage;
	@parse_str($args[1][0],$s);
	if(!@$s['t']&&@$s[$ext_frontpage[1]]!=$ext_frontpage[2]&&@$s['skip']!=''){
		foreach($s as $name => $value)if($name!='skip')$st[]=$name.'='.$value;
		if(count($st)>1)$str=implode('&',$st);
		else $str=$st[0];
			$ret=generate_link($ext_frontpage[1].'='.$ext_frontpage[2].'&'.$args[1][0]);
			return hook($ret);
	}
	else return hook($return);
}
$hook['ext_iurl'][]='ext_frontpage_blog_skip';